/**********************************************************************************************************************\
|								Class Function Definitions for Steering Behaviors									   |
\**********************************************************************************************************************/
#include "SteeringBehaviors.h"
#include "Enemy.h"



/***********************************************\
|				CONSTRUCTOR						| 
\***********************************************/
SteeringBehaviors::SteeringBehaviors()
{

}
SteeringBehaviors::SteeringBehaviors(Enemy* Agent)
{
	
}
SteeringBehaviors::SteeringBehaviors(SteeringBehaviors*)
{

}

/***********************************************\
|				CONSTRUCTOR						| 
\***********************************************/
SteeringBehaviors::~SteeringBehaviors()
{

}

/***********************************************\
|				SEEK BEHAVIOR					| 
\***********************************************/
point SteeringBehaviors::Seek(point& TargetPos)
{
		//Subtract the two points to get the vector between them
	point DesiredVelocity = TargetPos.difference(m_pEnemy->getLoc());
		//Normalize the Vector to create and identity vector only showing direction	
	DesiredVelocity.normalize();
		//Add in the speed of the object by multiplying
	DesiredVelocity.multiply(m_pEnemy->MaxSpeed());

		//Return the turning force needed to achieve the desired velocity
	return DesiredVelocity.difference(m_pEnemy->Velocity());
}	//End Seek()

void SteeringBehaviors::SeekOn()
{

}	//End SeekOn()

void SteeringBehaviors::SeekOff()
{

}	//End SeekOff()

/***********************************************\
|				FLEE BEHAVIOR					| 
\***********************************************/
point SteeringBehaviors::Flee(point& TargetPos)
{
		//Subtract the two points to get the vector between them
	point DesiredVelocity = m_pEnemy->getLoc().difference(TargetPos);
		//Normalize the Vector to create and identity vector only showing direction
	DesiredVelocity.normalize();
		//Add in the speed of the object by multiplying
	DesiredVelocity.multiply(m_pEnemy->MaxSpeed());
	
		//Return the turning force needed to achieve the desired velocity
	return DesiredVelocity.difference(m_pEnemy->Velocity());
}	//End Flee()

void SteeringBehaviors::FleeOn()
{

}	//End FleeOn()

void SteeringBehaviors::FleeOff()
{

}	//End FleeOff()

/***********************************************\
|				ARRIVE BEHAVIOR					| 
\***********************************************/
point SteeringBehaviors::Arrive(point& TargetPos, Deceleration deceleration)
{
		//Subtract the two points to get the vector between them
	point DesiredVelocity = TargetPos.difference(m_pEnemy->getLoc());


	
	return point(0,0);
}	//End Arrive()

void SteeringBehaviors::ArriveOn()
{

}	//End ArriveOn()

void SteeringBehaviors::ArriveOff()
{

}	//End ArriveOff()

/***********************************************\
|			OBSTACLE AVOIDANCE BEHAVIOR			| 
\***********************************************/
point SteeringBehaviors::ObstacleAvoidance()
{
	point DesiredVelocity(0,0);
	
	return DesiredVelocity;
}	//End ObstacleAvoidance()

void SteeringBehaviors::ObstacleAvoidanceOn()
{

}	//End ObstacleAvoidanceOn()

void SteeringBehaviors::ObstacleAvoidanceOff()
{

}	//End ObstacleAvoidanceOff()

/***********************************************\
|			WALL AVOIDANCE BEHAVIOR			| 
\***********************************************/
point SteeringBehaviors::WallAvoidance()
{
	point DesiredVelocity(0,0);
	
	return DesiredVelocity;
}	//End WallAvoidance()

void SteeringBehaviors::WallAvoidanceOn()
{

}	//End WallAvoidanceOn()

void SteeringBehaviors::WallAvoidanceOff()
{

}	//End WallAvoidanceOff()